import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const DataStatsMeta: IPublicTypeComponentMetadata = {
  "componentName": "DataStats",
  "title": "数据统计",
  "group": "首页",
  "category": "信息展示",
  "docUrl": "",
  "screenshot": "",
  "devMode": "proCode",
  "npm": {
    "package": "hzdz-charts",
    "version": "0.1.0",
    "exportName": "DataStats",
    "main": "src/index.tsx",
    "destructuring": true,
    "subName": ""
  },
  "configure": {
    "props": [
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "mainValue.text",
            "zh-CN": "主要数值"
          }
        },
        "name": "mainValue.text",
        "setter": {
          "componentName": "StringSetter",
          "isRequired": false,
          "initialValue": "35.19"
        }
      },
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "unitConfig.text",
            "zh-CN": "单位"
          }
        },
        "name": "unitConfig.text",
        "setter": {
          "componentName": "StringSetter",
          "isRequired": false,
          "initialValue": "万"
        }
      },
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "title.text",
            "zh-CN": "标题"
          }
        },
        "name": "title.text",
        "setter": {
          "componentName": "StringSetter",
          "isRequired": false,
          "initialValue": "铁路到发今日预测客流"
        }
      },
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "bottomPanel.leftText.text",
            "zh-CN": "左侧描述"
          }
        },
        "name": "bottomPanel.leftText.text",
        "setter": {
          "componentName": "StringSetter",
          "isRequired": false,
          "initialValue": "今日预测客流处于历史"
        }
      },
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "bottomPanel.rightText.rankNumber",
            "zh-CN": "排名数字"
          }
        },
        "name": "bottomPanel.rightText.rankNumber",
        "setter": {
          "componentName": "StringSetter",
          "isRequired": false,
          "initialValue": "1148"
        }
      },
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "mainValue.color",
            "zh-CN": "数值颜色"
          }
        },
        "name": "mainValue.color",
        "setter": {
          "componentName": "ColorSetter",
          "isRequired": false,
          "initialValue": "#1AD7FF"
        }
      },
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "backgroundImage",
            "zh-CN": "背景图片"
          }
        },
        "name": "backgroundImage",
        "setter": {
          "componentName": "StringSetter",
          "isRequired": false,
          "initialValue": "http://localhost:8085/static/images/shouye/sjzb.png"
        }
      }
    ],
    "supports": {
      "style": true
    },
    "component": {}
  }
};

const snippets: IPublicTypeSnippet[] = [
  {
    "title": "*数据统计",
    "screenshot": "",
    "schema": {
      "componentName": "DataStats",
      "props": {
        "width": 460,
        "height": 186,
        "backgroundImage": "http://localhost:8085/static/images/shouye/sjzb.png",
        "mainValue": {
          "text": "35.19",
          "fontSize": 28,
          "color": "#1AD7FF",
          "fontFamily": "DINAlternate",
          "fontWeight": "bold",
          "letterSpacing": "1px",
          "lineHeight": "28px",
          "gradient": {
            "enabled": true,
            "colors": ["#FFFFFF", "#81C6FF"],
            "direction": "90deg"
          }
        },
        "unitConfig": {
          "text": "万",
          "fontSize": 16,
          "color": "rgba(255,255,255,0.8)",
          "fontFamily": "SourceHanSansSC",
          "fontWeight": 500,
          "letterSpacing": "0.57px",
          "lineHeight": "24px"
        },
        "title": {
          "text": "铁路到发今日预测客流",
          "fontSize": 16,
          "color": "#FFFFFF",
          "fontFamily": "SourceHanSansSC",
          "fontWeight": 500,
          "letterSpacing": "0.57px",
          "lineHeight": "24px"
        },
        "bottomPanel": {
          "backgroundImage": "http://localhost:8085/static/images/shouye/bj51.png",
          "leftText": {
            "text": "今日预测客流处于历史",
            "fontSize": 16,
            "color": "rgba(255,255,255,0.9)",
            "fontFamily": "SourceHanSansSC",
            "fontWeight": 400,
            "letterSpacing": "0.57px",
            "lineHeight": "24px"
          },
          "rightText": {
            "text": "第",
            "rankNumber": "1148",
            "fontSize": 16,
            "color": "rgba(255,255,255,0.9)",
            "fontFamily": "SourceHanSansSC",
            "fontWeight": 500,
            "letterSpacing": "0.57px",
            "lineHeight": "24px"
          }
        },
        "theme": "dark"
      }
    }
  }
];

export default {
  ...DataStatsMeta,
  snippets
}; 